package com.example.personalaccount.repository;


import com.example.personalaccount.entity.User;
import com.example.personalaccount.entity.UserInform;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface UserInformRepository extends MongoRepository<UserInform,String> {
    UserInform getUserInformByUserId (long userId);

    List<UserInform> getUserInformByUsernameLike(String username);

    @Component
    interface UserRepository extends JpaRepository<User,Long> {

        User getUserById (long id);

        User getUserByUsername (String username);

        Page<User> findAll(Pageable pageable);
    }
}
